package com.test.data;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/test")
public class UserController {
    @Autowired
    UserService userService;

    @PostMapping("/user")
    public String addUser(@RequestBody User user) {
        return userService.addUser(user);
    }

    @GetMapping("/user")
    public User getUser(@RequestParam String id) {
        return userService.getUser(id);
    }
}
